# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
maintainer="Matthias Ahouansou <matthias@ahouansou.cz>"
pkgname=cargo-expand
pkgver=1.0.94
pkgrel=0
pkgdesc="Cargo subcommand to show result of macro expansion"
url="https://github.com/dtolnay/cargo-expand"
arch="all"
license="MIT OR Apache-2.0"
makedepends="cargo-auditable"
depends="cargo"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/dtolnay/cargo-expand/archive/refs/tags/$pkgver.tar.gz
"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 target/release/cargo-expand "$pkgdir"/usr/bin/cargo-expand

	for l in APACHE MIT
	do
		install -Dm 644 LICENSE-"$l" "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE-"$l"
	done
}

sha512sums="
2e037f97b398b6c657fee3e6abbcb2467fbe837cf987c5884e2fa87b7083a459b8acf9755b47daad3065b5018d91a3b543b10dd6c60121faf50837d3ada38daf  cargo-expand-1.0.94.tar.gz
"
